package com.yuanchu.order.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-01-24 16:10
 */
@Data
@NoArgsConstructor
public class Overview implements Serializable {
    private OverviewDetails orderTotalPrice;
    private OverviewDetails orderTotal;
    private OverviewDetails newUserTotal;
    private OverviewDetails consumeUserTotal;

    // 构造方法
    public Overview(BigDecimal priceYeday, BigDecimal priceToday,
                    long payOrdersYeday, long payOrdersToday,
                    String userByYesterday, String userByToday,
                    long payUsersYeday, long payUsersToday) {
        this.orderTotalPrice = new OverviewDetails(String.valueOf(priceYeday), String.valueOf(priceToday));
        this.orderTotal = new OverviewDetails(String.valueOf(payOrdersYeday), String.valueOf(payOrdersToday));
        this.newUserTotal = new OverviewDetails(String.valueOf(userByYesterday), String.valueOf(userByToday));
        this.consumeUserTotal = new OverviewDetails(String.valueOf(payUsersYeday), String.valueOf(payUsersToday));
    }




    // 内部类用于存储yda和tda的数据
    @Data
    public static class OverviewDetails {
        private String tday;
        private String ytd;
        public OverviewDetails() {
        }
        public OverviewDetails(String ydaValue, String tdaValue) {
            this.ytd = ydaValue;
            this.tday = tdaValue;
        }
    }
}